package com.project.mall.service;

import com.project.mall.mapper.MapperH;
import com.project.mall.pojo.*;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ServiceImplH implements ServiceH {
    @Resource
    private MapperH mapper;


    @Override
    public List<Goods> getAll() {
        return mapper.getAll();
    }



    @Override
    public List<Secondtype> getAllFirAndSec() {
        return mapper.getAllFirAndSec();
    }

    @Override
    public List<Goods> getGoodsListBySec(Integer secid) {
        return mapper.getGoodsListBySec(secid);
    }

    @Override
    public List<Goods> getGoodListByFir(Integer firid) {
        return mapper.getGoodListByFir(firid);
    }

    @Override
    public List<Goods> getHotGoods() {
        return mapper.getHotGoods();
    }

    @Override
    public List<Goods> getGoodsListByFirid(Integer firid) {
        return mapper.getGoodsListByFirid(firid);
    }

    @Override
    public List<Goods> getGoodsListBySecname(Integer firid,String secname) {
        return mapper.getGoodsListBySecname(firid,secname);
    }

    @Override
    public List<Goods> searchGoods(String name) {
        return mapper.searchGoods(name);
    }


//*******************************************************购物车订单模块*****************************************
    @Override
    public Goods getGoodsBygid(Integer gid) {
        return mapper.getGoodsBygid(gid);
    }

    @Override
    public Goodstype getTypeByid(Integer gtypeid) {
        return mapper.getTypeByid(gtypeid);
    }

    @Override
    public Goodscolor getColorByid(Integer gcolorid) {
        return mapper.getColorByid(gcolorid);
    }

    @Override
    public int AddMesToShopcar(Shoppingcar shoppingcar) {
        return mapper.AddMesToShopcar(shoppingcar);
    }

    @Override
    public List<Shoppingcar> getAllShoppingcar(Integer userid) {
        return mapper.getAllShoppingcar(userid);
    }

    @Override
    public List<Shoppingcar> getShoppingcarByid(Integer[] sid) {
        return mapper.getShoppingcarByid(sid);
    }

    @Override
    public int changeCount(Integer sid, Integer count) {
        return mapper.changeCount(sid, count);
    }

    @Override
    public int delcar(Integer sid) {
        return mapper.delcar(sid);
    }

    @Override
    public boolean addSuggest(Feedback feedback) {
        return mapper.addSuggest(feedback) > 0 ? true :false;
    }

    @Override
    public List<Address> getAddress(Integer userid) {
        return mapper.getAddress(userid);
    }
}
